import { ApiProperty } from '@nestjs/swagger';

export class BaseResponse {
  @ApiProperty({
    description: '响应码, 除0以外都是失败',
    type: Number,
  })
  code: number;

  @ApiProperty({
    description: '消息',
    type: String,
  })
  message: string;
}

export class PageResponse {
  @ApiProperty({
    description: '总记录数',
    type: Number,
  })
  total: number;

  @ApiProperty({
    description: '总页数',
    type: Number,
  })
  totalPages: number;

  @ApiProperty({
    description: '每页条数',
    type: Number,
  })
  pageSize: number;

  @ApiProperty({
    description: '当前页',
    type: Number,
  })
  page: number;
}

export class TimestampsWrapper {
  @ApiProperty({
    description: '创建时间',
    type: String,
  })
  createdAt: string;

  @ApiProperty({
    description: '更新时间',
    type: String,
  })
  updatedAt: string;
}
